import math
import random
import json

# Python对象转JSON字符串
data = {
    "name": "张三",
    "age": 25,
    "is_student": False,
    "hobbies": ["读书", "编程", "音乐"],
    "address": {"city": "北京", "street": "朝阳区"},
}
json_str = json.dumps(data, ensure_ascii=False, indent=2)

print(type(json_str), "value=", json_str)

# 把JSON字符串反序列化为JSON字典对象
new_dict = json.loads(json_str)
print(type(new_dict), "value=", new_dict)
